package cn.edu.scau.cmi.chenenting.composite.safe;

public class Leaf implements Component {
	
	private String name;
	private Composite father;
	
	public Leaf(String name) {
		this.name = name;
	}
	
	public String getName() {
		return this.name;
	}
	
	public Composite getFather() {
		return this.father;
	}
	
	public void display(String preStr) {
		Composite.result += preStr + "-" + name + "\n";
	}

	public void setFather(Composite father) {
		this.father = father;
	}
}
